<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>My Project: allocate.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">allocate.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#ifndef _ALLOCATE_HPP_</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#define _ALLOCATE_HPP_  1</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;kernelkeeper.tcc&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &quot;kernel.hpp&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &quot;port_info.hpp&quot;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &quot;fifo.hpp&quot;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;set&gt;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#if defined __AVX__ || __AVX2__</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#define ALLOC_ALIGN_WIDTH 32</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor">#define ALLOC_ALIGN_WIDTH 16</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor">#define INITIAL_ALLOC_SIZE 64</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="keyword">class </span><a class="code" href="class_map.html">Map</a>;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="keyword">class </span><a class="code" href="classbasic__parallel.html">basic_parallel</a>;</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="class_allocate.html">   54</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_allocate.html">Allocate</a></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;{</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;   <a class="code" href="class_allocate.html#a61d8b01e404c23ead20068035e3ba540">Allocate</a>( <a class="code" href="class_map.html">Map</a> &amp;map, <span class="keyword">volatile</span> <span class="keywordtype">bool</span> &amp;<a class="code" href="class_allocate.html#a4d10076b88ab1297c89b8a05e117b510">exit_alloc</a> );</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;   </div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;   <span class="keyword">virtual</span> <a class="code" href="class_allocate.html#a68cd61da26f3b82da094b6d3e5d556f5">~Allocate</a>();</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_allocate.html#a44f9b51c382fec159233609e21b9d272">run</a>() = 0;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;   <span class="keywordtype">void</span> <a class="code" href="class_allocate.html#a3123c2c1d9584974ce19b47fe6ceea17">waitTillReady</a>() ;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;   </div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;   <span class="keywordtype">void</span> <a class="code" href="class_allocate.html#a1d5c71b5cd6fc9671ed82d9c1d04965c">initialize</a>( <a class="code" href="struct_port_info.html">PortInfo</a> * <span class="keyword">const</span> src, </div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;                    <a class="code" href="struct_port_info.html">PortInfo</a> * <span class="keyword">const</span> dst, </div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                    FIFO * <span class="keyword">const</span> fifo );</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;   </div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;   <span class="keyword">virtual</span> <span class="keywordtype">void</span> allocate( <a class="code" href="struct_port_info.html">PortInfo</a> &amp;a, <a class="code" href="struct_port_info.html">PortInfo</a> &amp;b, <span class="keywordtype">void</span> *data );</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;   <span class="keywordtype">void</span> <a class="code" href="class_allocate.html#a4cf36bb704e43f5736a0e736d9e1a81b">setReady</a>() ;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div>
<div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="class_allocate.html#a93e612d7ea7eb686fc88b5dee7a1407b">  113</a></span>&#160;   kernelkeeper   &amp;<a class="code" href="class_allocate.html#a93e612d7ea7eb686fc88b5dee7a1407b">source_kernels</a>;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;   kernelkeeper   &amp;all_kernels;</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;   </div>
<div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="class_allocate.html#a037410210c0d10578f87de1ec68f47ba">  120</a></span>&#160;   std::set&lt; FIFO*   &gt; <a class="code" href="class_allocate.html#a037410210c0d10578f87de1ec68f47ba">allocated_fifo</a>;</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="class_allocate.html#a4d10076b88ab1297c89b8a05e117b510">  127</a></span>&#160;   <span class="keyword">volatile</span> <span class="keywordtype">bool</span> &amp;<a class="code" href="class_allocate.html#a4d10076b88ab1297c89b8a05e117b510">exit_alloc</a>;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;   <span class="keyword">volatile</span> <span class="keywordtype">bool</span> ready = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;   <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classbasic__parallel.html">basic_parallel</a>;</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;};</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* END _ALLOCATE_HPP_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="class_allocate_html_a4d10076b88ab1297c89b8a05e117b510"><div class="ttname"><a href="class_allocate.html#a4d10076b88ab1297c89b8a05e117b510">Allocate::exit_alloc</a></div><div class="ttdeci">volatile bool &amp; exit_alloc</div><div class="ttdef"><b>Definition:</b> allocate.hpp:127</div></div>
<div class="ttc" id="classbasic__parallel_html"><div class="ttname"><a href="classbasic__parallel.html">basic_parallel</a></div><div class="ttdef"><b>Definition:</b> basicparallel.hpp:48</div></div>
<div class="ttc" id="class_allocate_html_a4cf36bb704e43f5736a0e736d9e1a81b"><div class="ttname"><a href="class_allocate.html#a4cf36bb704e43f5736a0e736d9e1a81b">Allocate::setReady</a></div><div class="ttdeci">void setReady()</div><div class="ttdef"><b>Definition:</b> allocate.cpp:52</div></div>
<div class="ttc" id="class_allocate_html_a3123c2c1d9584974ce19b47fe6ceea17"><div class="ttname"><a href="class_allocate.html#a3123c2c1d9584974ce19b47fe6ceea17">Allocate::waitTillReady</a></div><div class="ttdeci">void waitTillReady()</div><div class="ttdef"><b>Definition:</b> allocate.cpp:46</div></div>
<div class="ttc" id="class_allocate_html_a68cd61da26f3b82da094b6d3e5d556f5"><div class="ttname"><a href="class_allocate.html#a68cd61da26f3b82da094b6d3e5d556f5">Allocate::~Allocate</a></div><div class="ttdeci">virtual ~Allocate()</div><div class="ttdef"><b>Definition:</b> allocate.cpp:37</div></div>
<div class="ttc" id="class_allocate_html_a037410210c0d10578f87de1ec68f47ba"><div class="ttname"><a href="class_allocate.html#a037410210c0d10578f87de1ec68f47ba">Allocate::allocated_fifo</a></div><div class="ttdeci">std::set&lt; FIFO * &gt; allocated_fifo</div><div class="ttdef"><b>Definition:</b> allocate.hpp:120</div></div>
<div class="ttc" id="class_allocate_html_a44f9b51c382fec159233609e21b9d272"><div class="ttname"><a href="class_allocate.html#a44f9b51c382fec159233609e21b9d272">Allocate::run</a></div><div class="ttdeci">virtual void run()=0</div></div>
<div class="ttc" id="class_map_html"><div class="ttname"><a href="class_map.html">Map</a></div><div class="ttdef"><b>Definition:</b> map.hpp:47</div></div>
<div class="ttc" id="class_allocate_html"><div class="ttname"><a href="class_allocate.html">Allocate</a></div><div class="ttdef"><b>Definition:</b> allocate.hpp:54</div></div>
<div class="ttc" id="class_allocate_html_a61d8b01e404c23ead20068035e3ba540"><div class="ttname"><a href="class_allocate.html#a61d8b01e404c23ead20068035e3ba540">Allocate::Allocate</a></div><div class="ttdeci">Allocate(Map &amp;map, volatile bool &amp;exit_alloc)</div><div class="ttdef"><b>Definition:</b> allocate.cpp:30</div></div>
<div class="ttc" id="struct_port_info_html"><div class="ttname"><a href="struct_port_info.html">PortInfo</a></div><div class="ttdef"><b>Definition:</b> port_info.hpp:39</div></div>
<div class="ttc" id="class_allocate_html_a1d5c71b5cd6fc9671ed82d9c1d04965c"><div class="ttname"><a href="class_allocate.html#a1d5c71b5cd6fc9671ed82d9c1d04965c">Allocate::initialize</a></div><div class="ttdeci">void initialize(PortInfo *const src, PortInfo *const dst, FIFO *const fifo)</div><div class="ttdef"><b>Definition:</b> allocate.cpp:58</div></div>
<div class="ttc" id="class_allocate_html_a93e612d7ea7eb686fc88b5dee7a1407b"><div class="ttname"><a href="class_allocate.html#a93e612d7ea7eb686fc88b5dee7a1407b">Allocate::source_kernels</a></div><div class="ttdeci">kernelkeeper &amp; source_kernels</div><div class="ttdef"><b>Definition:</b> allocate.hpp:113</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
